package com.weilong.lw.myunittestdemo;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.Window;
import android.widget.Button;

import com.weilong.lw.myunittestdemo.actionbar.ActionActivity;
import com.weilong.lw.myunittestdemo.toolbar.MyToolbar1Activity;
import com.weilong.lw.myunittestdemo.toolbar1.MyToolbarActivity;
import com.weilong.lw.myunittestdemo.toolbar2.Toolbar1Activity;
import com.weilong.lw.myunittestdemo.yuanshengToolBar.ToolActivity;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    private Button btn_actionbar;
    private Button btn_toolbar;
    private Button btn_toolbar1;
    private Button btn_toolbar2;
    private Button btn_toolbar3;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_main);
        initView();


    }


    private void initView() {
        btn_actionbar = (Button) findViewById(R.id.btn_actionbar);
        btn_toolbar = (Button) findViewById(R.id.btn_toolbar);

        btn_actionbar.setOnClickListener(this);
        btn_toolbar.setOnClickListener(this);
        btn_toolbar1 = (Button) findViewById(R.id.btn_toolbar1);
        btn_toolbar1.setOnClickListener(this);
        btn_toolbar2 = (Button) findViewById(R.id.btn_toolbar2);
        btn_toolbar2.setOnClickListener(this);
        btn_toolbar3 = (Button) findViewById(R.id.btn_toolbar3);
        btn_toolbar3.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        Intent intent = new Intent();
        switch (v.getId()) {
            case R.id.btn_actionbar:
                intent.setClass(MainActivity.this, ActionActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_toolbar:
                intent.setClass(MainActivity.this, ToolActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_toolbar1:
                intent.setClass(MainActivity.this, MyToolbarActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_toolbar2:
                intent.setClass(MainActivity.this, MyToolbar1Activity.class);
                startActivity(intent);
                break;
            case R.id.btn_toolbar3:
                intent.setClass(MainActivity.this, Toolbar1Activity.class);
                startActivity(intent);
                break;
        }
    }
}
